import * as types from '../types';
import { ILoginActionType } from '../actions';
import { ILoginState } from '../interfaces';

export const loginInitalState: ILoginState = {
    userName: 'jiaweizhao',
    userId: '1',
    vipMember: true,
    isMale: true,
    image: '',
};

export const loginReducer = (state = loginInitalState, action: ILoginActionType): ILoginState => {
    switch (action.type) {
        case types.NIGHTSTAR_LOGIN_INITALSET:
            return {
                ...state,
                ...action.state,
            };
        default:
            return state;
    }
};
